package com.example.lab2;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;

public class ListActivity extends Activity {

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list);

		int c = 0;
		String s1 = "";
		String s2 = "";
		String s3 = "";
		String s4 = "";
		String s5 = "";
		String s6 = "";
		String s7 = "";
		String s8 = "";
		String s9 = "";
		String s10 = "";
		String s11 = "";
		String s12 = "";
		String s13 = "";
		String s14 = "";
		String s15 = "";
		String s16 = "";
		String s17 = "";
		String s18 = "";
		String s19 = "";
		String s20 = "";
		String s21 = "";
		String s22 = "";
		String s23 = "";
		String s24 = "";
		String s25 = "";

		ArrayList<String> mylist = getIntent().getExtras().getStringArrayList(
				"list");
		int size = mylist.size() - 1;
		for (int i = 0; i < mylist.size(); i++) {
			if (c <= 0) {
				s5 = s5 + mylist.get(size - c);
			}
			if (c <= 1 && c > 0) {
				s4 = s4 + mylist.get(size - c);
			}
			if (c <= 2 && c > 1) {
				s3 = s3 + mylist.get(size - c);
			}
			if (c <= 3 && c > 2) {
				s2 = s2 + mylist.get(size - c);
			}
			if (c <= 4 && c > 3) {
				s1 = s1 + mylist.get(size - c);
			}

			if (c <= 5 && c > 4) {
				s10 = s10 + mylist.get(size - c);
			}
			if (c <= 6 && c > 5) {
				s9 = s9 + mylist.get(size - c);
			}
			if (c <= 7 && c > 6) {
				s8 = s8 + mylist.get(size - c);
			}
			if (c <= 8 && c > 7) {
				s7 = s7 + mylist.get(size - c);
			}
			if (c <= 9 && c > 8) {
				s6 = s6 + mylist.get(size - c);
			}

			if (c <= 10 && c > 9) {
				s15 = s15 + mylist.get(size - c);
			}
			if (c <= 11 && c > 10) {
				s14 = s14 + mylist.get(size - c);
			}
			if (c <= 12 && c > 11) {
				s13 = s13 + mylist.get(size - c);
			}
			if (c <= 13 && c > 12) {
				s12 = s12 + mylist.get(size - c);
			}
			if (c <= 14 && c > 13) {
				s11 = s11 + mylist.get(size - c);
			}
			if (c <= 15 && c > 14) {
				s20 = s20 + mylist.get(size - c);
			}
			if (c <= 16 && c > 15) {
				s19 = s19 + mylist.get(size - c);
			}
			if (c <= 17 && c > 16) {
				s18 = s18 + mylist.get(size - c);
			}
			if (c <= 18 && c > 17) {
				s17 = s17 + mylist.get(size - c);
			}
			if (c <= 19 && c > 18) {
				s16 = s16 + mylist.get(size - c);
			}
			if (c <= 20 && c > 19) {
				s25 = s25 + mylist.get(size - c);
			}
			if (c <= 21 && c > 20) {
				s24 = s24 + mylist.get(size - c);
			}
			if (c <= 22 && c > 21) {
				s23 = s23 + mylist.get(size - c);
			}
			if (c <= 23 && c > 22) {
				s22 = s22 + mylist.get(size - c);
			}
			if (c <= 24 && c > 23) {
				s21 = s21 + mylist.get(size - c);
			}

			c++;

		}

		TextView tw = (TextView) findViewById(R.id.activity_list_item1);
		tw.setText(s1);
		TextView tw2 = (TextView) findViewById(R.id.activity_list_item2);
		tw2.setText(s2);
		TextView tw3 = (TextView) findViewById(R.id.activity_list_item3);
		tw3.setText(s3);
		TextView tw4 = (TextView) findViewById(R.id.activity_list_item4);
		tw4.setText(s4);
		TextView tw5 = (TextView) findViewById(R.id.activity_list_item5);
		tw5.setText(s5);

		TextView tw6 = (TextView) findViewById(R.id.activity_list_item21);
		tw6.setText(s6);
		TextView tw7 = (TextView) findViewById(R.id.activity_list_item22);
		tw7.setText(s7);
		TextView tw8 = (TextView) findViewById(R.id.activity_list_item23);
		tw8.setText(s8);
		TextView tw9 = (TextView) findViewById(R.id.activity_list_item24);
		tw9.setText(s9);
		TextView tw10 = (TextView) findViewById(R.id.activity_list_item25);
		tw10.setText(s10);

		TextView tw11 = (TextView) findViewById(R.id.activity_list_item31);
		tw11.setText(s11);
		TextView tw12 = (TextView) findViewById(R.id.activity_list_item32);
		tw12.setText(s12);
		TextView tw13 = (TextView) findViewById(R.id.activity_list_item33);
		tw13.setText(s13);
		TextView tw14 = (TextView) findViewById(R.id.activity_list_item34);
		tw14.setText(s14);
		TextView tw15 = (TextView) findViewById(R.id.activity_list_item35);
		tw15.setText(s15);
		
		TextView tw16 = (TextView) findViewById(R.id.activity_list_item41);
		tw16.setText(s16);
		TextView tw17 = (TextView) findViewById(R.id.activity_list_item42);
		tw17.setText(s17);
		TextView tw18 = (TextView) findViewById(R.id.activity_list_item43);
		tw18.setText(s18);
		TextView tw19 = (TextView) findViewById(R.id.activity_list_item44);
		tw19.setText(s19);
		TextView tw20 = (TextView) findViewById(R.id.activity_list_item45);
		tw20.setText(s20);
		
		TextView tw21 = (TextView) findViewById(R.id.activity_list_item51);
		tw21.setText(s21);
		TextView tw22 = (TextView) findViewById(R.id.activity_list_item52);
		tw22.setText(s22);
		TextView tw23 = (TextView) findViewById(R.id.activity_list_item53);
		tw23.setText(s23);
		TextView tw24 = (TextView) findViewById(R.id.activity_list_item54);
		tw24.setText(s24);
		TextView tw25 = (TextView) findViewById(R.id.activity_list_item55);
		tw25.setText(s25);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;

	}
}
